package Demo11;

import java.util.Arrays;

/*

 */
public class Demo02ArraysPractise {
    public static void main(String[] args) {
        String str="aaskdlfoireu";

        //排列 sort
        //数组-->Arrays.sort
        //String--->数组.toCharArray

        char[] chars = str.toCharArray();
        Arrays.sort(chars);

        //遍历----升序
        for (int i = 0; i < chars.length; i++) {
            System.out.println(chars[i]);
        }

        System.out.println("=================");
        //遍历----倒序
        for (int i = chars.length - 1; i >= 0; i--) {
            System.out.println(chars[i]);
        }
    }
}
